<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" +request.getServerPort() + path + "/";
%>
<jsp:include page="head.jsp"></jsp:include>

	<div class="main">
		<h2>修改分类</h2>
		<div class="manage">
			<form action="<%=basePath%>ChangeClassify_Servlet" method="POST">
			   
				<table class="form">
				<!-- 判断用户是在修改大类还是小类 -->
				<!-- 小分类 -->
				<c:if test="${map1.CommodityClassify.small_id!=0}">
				  		<tr>
						<td class="field">父分类：</td>
						<td>
							<select name="cpid">
 <c:if test="${map1!=null}">
   <c:if test="${map1.ClassifyList!=null }">
     <c:forEach items="${map1.ClassifyList}" var="obj">  
	          <option value="${obj.big_id}"><c:out value="-----${obj.big_name}----"></c:out> </option>		
  </c:forEach>
   </c:if>
</c:if>
							</select>
						</td>
					</tr>
					<tr>
						<td class="field">分类名称：</td>
						<td>
						   
							<input type="text" class="text" name="cname"/>
							<input type="hidden" name="smallid" value="${map1.CommodityClassify.small_id}" />
						</td>
					</tr>
					
				</c:if>
				<!-- 这是大类 -->
				<c:if test="${map1.CommodityClassify.small_id==0}">
				<tr>
				<td class="field">原父分类名：<c:out value="${map1.CommodityClassify.big_name}"></c:out></td>
				<input type="hidden" name="bigid" value="${map1.CommodityClassify.big_id}" />
				 </tr>
				<tr>
						<td class="field">分类名称：</td>
						<td>
							<input type="text" class="text" name="bigname"/>
						</td>
					</tr>
				</c:if>
			            <tr>
						<td></td>
						<td><label class="ui-blue"><input type="submit" value="更新" /></label></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
<jsp:include page="foot.jsp"></jsp:include>
<script type="text/javascript">
	$(function(){
			$(".manage_navbar").removeClass("current");
			$(".product_jsp").addClass("current");
			if("${tips}" == "failure") {
				layer.open({
					type: 1,
					title: false, //不显示标题栏
					closeBtn: false,
					area:['200px','150px'],
					shade: 0.8,
					moveType: 1, //拖拽模式，0或者1
					content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300; font-size:22px;">更新失败</div>',
					time: 2000,
				});
			};
	});
</script>